#include<iostream>
#include<unistd.h>
#include<cstdio>
#include<sys/types.h>
#include<sys/wait.h>
using namespace std;
int main()
{
  pid_t id = fork();
  if(id == 0)
  {
    execlp("ls","-l","--color","-aln",nullptr);
  }
  pid_t rid = waitpid(id,nullptr,0);
  if(rid>0)
    cout<<"等待子进程成功"<<endl;
  return 0;
}
